<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>驴妈妈慧眼系统</title>
    <meta name="description" content="overview &amp; stats"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/bootstrap.css"/>
    <link rel="stylesheet"
          href="${request.contextPath}/static/assets/font-awesome/4.5.0/css/font-awesome.min.css"/>
    <!-- page specific plugin styles -->
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/jquery.gritter.min.css"/>
    <!-- text fonts -->
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/fonts.googleapis.com.css"/>
    <!-- ace styles -->
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace.min.css"
          class="ace-main-stylesheet" id="main-ace-style"/>
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace-skins.min.css"/>
    <link rel="stylesheet" href="${request.contextPath}/static/assets/css/ace-rtl.min.css"/>
    <link rel="stylesheet" href="${request.contextPath}/static/stylesheets/daterangepicker.css">
    <script src="${request.contextPath}/static/assets/js/jquery-2.1.4.min.js"></script>
    <!-- ace settings handler -->
    <script src="${request.contextPath}/static/assets/js/ace-extra.min.js"></script>
    <style>
        #dynamic-table2{
        // width:100px;
            table-layout:fixed;/* 只有定义了表格的布局算法为fixed，下面td的定义才能起作用。 */
        }
        #hotel table td{
           // width:100%;
            word-break:keep-all;/* 不换行 */
            white-space:nowrap;/* 不换行 */
            overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
            text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用*/
        }
    </style>
</head>

<body class="no-skin" style="background-color: #FFF;overflow-x : hidden;">
<div class="page-content" style="padding: 2px 2px 0px;">
    <div class="tabbable">
        <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab4">
            <li class="<#if !validateProductListConditionVO.type?? || validateProductListConditionVO.type == 'ticket'>active</#if>">
                <a data-toggle="tab" href="#ticket" aria-expanded="false">TC门票</a>
            </li>
            <li class="<#if validateProductListConditionVO.type?? && validateProductListConditionVO.type == 'hotel'>active in</#if>">
                <a data-toggle="tab" href="#hotel" aria-expanded="false">TC酒店</a>
            </li>
        </ul>

        <div class="tab-content">
            <div id="ticket" class="tab-pane <#if !validateProductListConditionVO.type?? || validateProductListConditionVO.type == 'ticket'>active in</#if>">
                <form class="form-inline" id="searchForm" method="post"
                      action="${request.contextPath}/validateProduct/TCValidateProductList">
                    <input type="hidden" id="_csrf" name="${_csrf.parameterName}"
                           value="${_csrf.token}"/>
                    <!-- 框架原因，所有post请求必须加这行代码 -->
                    <input type="hidden" id="type" name="type" value="ticket">
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="ticket_year" name="dateVO" type="radio" class="ace" value="Y"
                                       onclick="changeTime()">
                                <span class="lbl">年</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="ticket_quarter" name="dateVO" type="radio" class="ace" value="Q"
                                       onclick="changeTime()">
                                <span class="lbl">季</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="ticket_month" name="dateVO" type="radio" class="ace" value="M" checked
                                       onclick="changeTime()">
                                <span class="lbl">月</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="ticket_week" name="dateVO" type="radio" class="ace" value="W"
                                       onclick="changeTime()">
                                <span class="lbl">周</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-3">
                        <div class="dataTables_length">
                            <input id="ticket_taskid" name="dateVO" type="radio" class="ace" value="taskID"
                                   onclick="changeTaskID()">
                            <span class="lbl">批次号</span>
                            <input class="form-control" id="ticket_inputtask" name="taskIDVO" placeholder="批次号"
                                   type="text">
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="dataTables_length">
                            <button type="submit" class="btn btn-pink btn-sm" id="search">
                                <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                查询
                            </button>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="dataTables_length" onclick="ticket_save()">
                            <div class="btn btn-pink btn-sm">
                                <span class="ace-icon fa  icon-on-right bigger-110"></span>
                                保存
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="dataTables_length">
                            <div class="btn btn-pink btn-sm" id="search" onclick="ticket_delete()">
                                <span class="ace-icon fa icon-on-right bigger-110"></span>
                                删除
                            </div>
                        </div>
                    </div>
                </form>
                <br><br>
                <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer"
                       role="grid" aria-describedby="dynamic-table_info">
                    <thead>
                    <tr>
                        <th>商品id</th>
                        <th>商品名称</th>
                        <th>批次号</th>
                        <th>价格</th>
                        <th>爬取时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if TCTicket_CommodityDetailList?? && TCTicket_CommodityDetailList?size&gt;0>
                        <#list TCTicket_CommodityDetailList as ticketVO>
                            <tr class="">
                                <td>${ticketVO.commodity_id!}</td>
                                <td title="${ticketVO.commodity_name!}">${ticketVO.commodity_name!}</td>
                                <td>${ticketVO.task_id!}</td>
                                <td>￥${ticketVO.sale_price!}</td>
                                <td>${ticketVO.create_time?string('yyyy.MM.dd')!}</td>

                                <td>
                                    <div class="hidden-sm hidden-xs action-buttons" align="right">
                                        <a class="green" title="保存" onclick="saveOneTicket('${ticketVO.detail_id!}');">
                                            <i class="ace-icon fa fa-check bigger-120"></i>
                                        </a>
                                        <a class="green" title="编辑" onclick="updateOneTicket('${ticketVO.detail_id!}');"
                                           role="button">
                                            <i class="ace-icon fa fa-pencil bigger-130"></i>
                                        </a>
                                        <a class="red" title="删除" onclick="deleteOneTicket('${ticketVO.detail_id!}');">
                                            <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        </#list>
                        <#else>
                            <tr>
                                <td colspan="12">
                                    <div class="alert alert-danger" style="margin-bottom: 0px;"
                                         role="alert">没有记录!
                                    </div>
                                </td>
                            </tr>
                    </#if>
                    </tbody>
                </table>
                <#if TCTicket_CommodityDetailList?? && TCTicket_CommodityDetailList?size&gt;0>
                    <#include "/paginator.html">
                </#if>
            </div>

            <div id="hotel" class="tab-pane <#if validateProductListConditionVO.type?? && validateProductListConditionVO.type == 'hotel'>active in</#if>">
                <form class="form-inline" id="searchForm2" method="post"
                      action="${request.contextPath}/validateProduct/hotelValidateProductList">
                    <input type="hidden" id="_csrf" name="${_csrf.parameterName}"
                           value="${_csrf.token}"/>
                    <!-- 框架原因，所有post请求必须加这行代码 -->
                    <input type="hidden" id="type" name="type" value="hotel">
                    <input type="hidden" id="companyCode" name="companyCode" value="TC_C_CODE"/>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="hotel_year" name="dateVO" type="radio" class="ace" value="Y" onclick="changeHotelTime()">
                                <span class="lbl">年</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="hotel_quarter" name="dateVO" type="radio" class="ace" value="Q" onclick="changeHotelTime()">
                                <span class="lbl">季</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="hotel_month" name="dateVO" type="radio" class="ace" value="M" checked onclick="changeHotelTime()">
                                <span class="lbl">月</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="radio">
                            <label>
                                <input id="hotel_week" name="dateVO" type="radio" class="ace" value="W" onclick="changeHotelTime()">
                                <span class="lbl">周</span>
                            </label>
                        </div>
                    </div>
                    <div class="col-xs-3">
                        <div class="dataTables_length">
                            <input id="hotel_taskid" name="dateVO" type="radio" class="ace" value="taskID" onclick="changeHotelTaskID()">
                            <span class="lbl">批次号</span>
                            <input id="hotel_inputtask" class="form-control" name="taskIDVO" placeholder="批次号" type="text">

                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="dataTables_length">
                            <button class="btn btn-pink btn-sm">
                                <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                查询
                            </button>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="dataTables_length">
                            <div class="btn btn-pink btn-sm" id="search" onclick="hotel_save()">
                                <span class="ace-icon fa  icon-on-right bigger-110"></span>
                                保存
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-1 col-sm-1">
                        <div class="dataTables_length">
                            <div class="btn btn-pink btn-sm" id="search" onclick="hotel_delete()">
                                <span class="ace-icon fa icon-on-right bigger-110"></span>
                                删除
                            </div>
                        </div>
                    </div>
                </form>
                <br><br>
                <table id="dynamic-table2" class="table table-striped table-bordered table-hover dataTable no-footer"
                       role="grid" aria-describedby="dynamic-table_info">
                    <thead>
                    <tr>
                        <th class="center" style="width:3%">
                            <label class="pos-rel">
                                <input type="checkbox" class="ace"/>
                                <span class="lbl"></span>
                            </label>
                        </th>
                        <th>商品id</th>
                        <th>商品名称</th>
                        <th>产品id</th>
                        <th>批次号</th>
                        <th>房型</th>
                        <th>房间面积</th>
                        <th>床型</th>
                        <th>楼层</th>
                        <th>宽带</th>
                        <th>早餐</th>
                        <th>窗户</th>
                        <th>入住人数</th>
                        <th>价格</th>
                        <th>抓取时间</th>
                        <th>校验失败原因</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if Hotel_CommodityDetailList?? && Hotel_CommodityDetailList?size&gt;0>
                        <#list Hotel_CommodityDetailList as hotelVO>
                            <tr class="">
                                <td class="center" style="width:3%;">
                                    <label class="pos-rel">
                                        <input type="checkbox" class="ace"/>
                                        <span class="lbl"></span>
                                    </label>
                                </td>
                                <td title="${hotelVO.commodityId!}">${hotelVO.commodityId!}</td>
                                <td title="${hotelVO.commodityName!}">${hotelVO.commodityName!}</td>
                                <td title="${hotelVO.productId!}">${hotelVO.productId!}</td>
                                <td title="${hotelVO.taskId!}">${hotelVO.taskId!}</td>
                                <td title="${hotelVO.roomType!}">${hotelVO.roomType!}</td>
                                <td title="${hotelVO.area!}">${hotelVO.area!}</td>
                                <td title="${hotelVO.bedType!}">${hotelVO.bedType!}</td>
                                <td title="${hotelVO.floor!}">${hotelVO.floor!}</td>
                                <td title="${hotelVO.broadband!}">${hotelVO.broadband!}</td>
                                <td title="${hotelVO.breakfast!}">${hotelVO.breakfast!}</td>
                                <td title="${hotelVO.window!}">${hotelVO.window!}</td>
                                <td title="${hotelVO.peopleNum!}">${hotelVO.peopleNum!}</td>
                                <td title="${hotelVO.salePrice!}">${hotelVO.salePrice!}</td>
                                <td title="${hotelVO.createTime?string('yyyy.MM.dd')!}">${hotelVO.createTime?string('yyyy.MM.dd')}</td>
                                <td title="${hotelVO.convertErrorMsg!}">${hotelVO.convertErrorMsg!}</td>
                                <td>
                                    <div class="hidden-sm hidden-xs action-buttons" align="right">
                                        <a class="green" title="保存" onclick="saveOneHotel('${hotelVO.commodityId!}','${hotelVO.productId!}','${hotelVO.taskId!}','${hotelVO.companyCode!}');">
                                            <i class="ace-icon fa fa-check bigger-120"></i>
                                        </a>
                                        <!--  <a class="green" title="编辑" onclick="updateOneHotel('${hotelVO.id!}');"
                                             role="button">
                                              <i class="ace-icon fa fa-pencil bigger-130"></i>
                                          </a>-->
                                        <a class="red" title="删除" onclick="deleteOneHotel('${hotelVO.commodityId!}','${hotelVO.productId!}','${hotelVO.taskId!}','${hotelVO.companyCode!}');">
                                            <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                        </#list>
                        <#else>
                            <tr>
                                <td colspan="17">
                                    <div class="alert alert-danger" style="margin-bottom: 0px;"
                                         role="alert">没有记录!
                                    </div>
                                </td>
                            </tr>
                    </#if>
                    </tbody>
                </table>
                <#if Hotel_CommodityDetailList?? && Hotel_CommodityDetailList?size&gt;0>
                    <#include "/paginator2.html">
                </#if>
                <div>
                    <h4 class="text-warning bigger-110 orange">
                        <i class="ace-icon fa fa-exclamation-triangle"></i>
                        提交旁边的保存和优先复选框勾选再到输入批次号再到时间切换
                    </h4>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <button class="btn btn-info" data-toggle="modal" type="button"
                style="display: none;" id="update" data-target="#myModal">
        </button>
        <div id="updateCode" class="form-horizontal" role="form">
            <!-- <input type="hidden" id="_csrf" name="${_csrf.parameterName}"
                            value="${_csrf.token}" /> -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
                 aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"
                                    aria-hidden="true">×
                            </button>
                            <h4 class="modal-title" id="myModalLabel">商品信息</h4>
                        </div>
                        <div class="modal-body">
                            <input id="detail_id" name="detail_id" value="" type="hidden">
                            <div class="space-4"></div>
                            <div class="form-group">
                                <div class="col-sm-9">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"
                                               for="form-field-1"> 商品名称 </label>

                                        <div class="col-sm-9">
                                            <input type="text" id="commodity_name" name="commodity_name"
                                                   placeholder="商品名称" class="form-control" required="required">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label no-padding-right"
                                               for="form-field-1"> 商品售价 </label>

                                        <div class="col-sm-9">
                                            <input type="text" id="sale_price" name="sale_price"
                                                   placeholder=" 商品售价" class="form-control" required="required">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-pink btn-sm"
                                    data-dismiss="modal">关闭
                            </button>
                            <button type="submit" class="btn btn-pink btn-sm" onclick="ticketAdd()">
                                提交
                            </button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal -->
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="companyCode" value="TC_C_CODE"/>
<input type="hidden" id="tcValidateProContext" value="${request.contextPath}"/>
<script src="${request.contextPath}/static/assets/js/bootstrap.min.js"></script>

<!-- page specific plugin scripts -->
<script src="${request.contextPath}/static/assets/js/jquery-ui.min.js"></script>
<script src="${request.contextPath}/static/assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="${request.contextPath}/static/assets/js/jquery.gritter.min.js"></script>
<!-- ace scripts -->
<script src="${request.contextPath}/static/assets/js/ace-elements.min.js"></script>
<script src="${request.contextPath}/static/assets/js/ace.min.js"></script>
<script src="${request.contextPath}/static/assets/js/bootbox.js"></script>
<!-- user scripts -->
<script src="${request.contextPath}/static/assets/js/user/base.js"></script>

<script type="text/javascript" src="${request.contextPath}/static/javascripts/moment.js"></script>
<script type="text/javascript" src="${request.contextPath}/static/javascripts/daterangepicker.js"></script>
<script type="text/javascript">
    var validateProContext = $("#tcValidateProContext").val();
</script>
<script type="text/javascript" src="${request.contextPath}/static/javascripts/hotel.js"></script>

<script type="text/javascript">
    var tcValidateProContext = $("#tcValidateProContext").val();
    var dateVO = '${validateProductListConditionVO.dateVO!}';
    var taskIDVO = '${validateProductListConditionVO.taskIDVO!}';
    var type = '${validateProductListConditionVO.type!}';
    if (dateVO != null && dateVO != "") {
        if(type == "hotel"){
            $("#hotel").find("input[name='dateVO'][value=" + dateVO + "]").attr("checked", true);
            $("#hotel_inputtask").val(taskIDVO);
        }else{
            $("#ticket").find("input[name='dateVO'][value=" + dateVO + "]").attr("checked", true);
            $("#ticket_inputtask").val(taskIDVO);
        }
    }

    if (type == "hotel") {
        $(".nav-tabs li").removeClass("active");
        $(".nav-tabs li").eq(1).addClass("active");
        $(".tab-content div").removeClass("active");
        $("#hotel").addClass("active");
    }

    function changeTime() {
        $("#ticket_inputtask").val("");
        $("#ticket_inputtask").attr("required", false);
    }

    function changeTaskID() {
        $("#ticket_inputtask").attr("required", true);
    }

    function updateOneTicket(detail_id) {
        $.ajax({
            url: tcValidateProContext + '/validateProduct/TicketEdit?detail_id=' + detail_id,
            type: "GET",
            success: function (data) {
                if (data.sessionStatus == 540) {//异步请求session过期状态
                    window.location.href = tcValidateProContext + "/login";
                } else if (data.code == "1") {
                    var ticketVO = data.ticketVO;
                    $("#myModal").modal("show");
                    $('#commodity_name').val(ticketVO.commodity_name);//商品名称
                    $('#sale_price').val(ticketVO.sale_price);//售价
                    $("#detail_id").val(ticketVO.detail_id);
                }
            }
        });
    }

    function ticketAdd() {
        if ($(".nav-tabs li").eq(1).hasClass("active")) {
            hotelAdd();
            return;
        }
        var detail_id = $("#detail_id").val();
        var dateVO = $("#ticket").find("input[name='dateVO']:checked").val();
        var taskID = $("#ticket_inputtask").val();
        var commodity_name = $("#commodity_name").val();
        var sale_price = $("#sale_price").val();
        $.ajax({
            url: tcValidateProContext + '/validateProduct/ticketAdd?detail_id=' + detail_id + '&dateVO=' + dateVO + '&taskIDVO=' + taskID + '&commodity_name=' + commodity_name + '&sale_price=' + sale_price,
            type: "GET",
            async: false,
            dataType: "json",
            success: function (data) {
                if (data.sessionStatus == 540) {//异步请求session过期状态
                    window.location.href = tcValidateProContext + "/login";
                    return;
                } else if (data.code == "-1") {
                    bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据修改失败！</strong>", function () {
                        window.location.reload();
                    });
                } else {
                    bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据修改成功！</strong>", function () {
                        window.location.reload();
                    });
                }
            }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据修改失败！</strong>");
            }
        });
    }

    function saveOneTicket(detail_id) {
        var dateVO = $("#ticket").find("input[name='dateVO']:checked").val();
        var taskID = $("#ticket_inputtask").val();
        bootbox.confirm("<strong style='font-size:15px;padding-left:200px'>确认保存该条数据吗？</strong>", function (result) {
            if (result) {
                $.ajax({
                    url: tcValidateProContext + '/validateProduct/saveOneTicket?detail_id=' + detail_id + '&dateVO=' + dateVO + '&taskIDVO=' + taskID,
                    type: "GET",
                    async: false,
                    dataType: "json",
                    success: function (data) {
                        if (data.sessionStatus == 540) {//异步请求session过期状态
                            window.location.href = tcValidateProContext + "/login";
                            return;
                        } else if (data.code == "-1") {
                            bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据保存失败！</strong>", function () {
                                window.location.reload();
                            });
                        } else {
                            bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据保存成功！</strong>", function () {
                                window.location.reload();
                            });
                        }
                    }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据保存失败！</strong>");
                    }
                });
            }
        });

    }

    function deleteOneTicket(detail_id) {
        var dateVO = $("#ticket").find("input[name='dateVO']:checked").val();
        var taskID = $("#ticket_inputtask").val();
        bootbox.confirm("<strong style='font-size:15px;padding-left:200px'>确认删除该条数据吗？</strong>", function (result) {
            if (result) {
                $.ajax({
                    url: tcValidateProContext + '/validateProduct/deleteOneTicket?detail_id=' + detail_id + '&dateVO=' + dateVO + '&taskIDVO=' + taskID,
                    type: "GET",
                    async: false,
                    success: function (data) {
                        if (data.sessionStatus == 540) {//异步请求session过期状态
                            window.location.href = tcValidateProContext + "/login";
                            return;
                        }
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据删除成功！</strong>", function () {
                            window.location.reload();
                        });
                    }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据删除失败！</strong>");
                    }
                });
            }
        });

    }


    function ticket_save() {
        var dateVO = $("#ticket").find("input[name='dateVO']:checked").val();
        var taskID = $("#ticket_inputtask").val();
        if (dateVO == "taskID") {
            if (taskID == "") {
                bootbox.alert("<strong style='font-size:15px;padding-left:200px'>请填写 taskID!</strong>");
                return false;
            }
        }
        bootbox.confirm("<strong style='font-size:15px;padding-left:200px'>确认保存所有数据吗？</strong>", function (result) {
            if (result) {
                $.ajax({
                    url: tcValidateProContext + '/validateProduct/TicketSaveBatch?dateVO=' + dateVO + '&taskIDVO=' + taskID,
                    type: "GET",
                    async: false,
                    success: function (data) {
                        if (data.sessionStatus == 540) {//异步请求session过期状态
                            window.location.href = tcValidateProContext + "/login";
                            return;
                        }
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据保存成功！</strong>", function () {
                            window.location.reload();
                        });
                    }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据保存失败！</strong>", function () {
                            window.location.reload();
                        });
                    }
                });
            }
        });

    }


    function ticket_delete() {
        var dateVO = $("#ticket").find("input[name='dateVO']:checked").val();
        var taskID = $("#ticket_inputtask").val();
        if (dateVO == "taskID") {
            if (taskID == "") {
                bootbox.alert("<strong style='font-size:15px;padding-left:200px'>请填写 taskID!</strong>");
                return false;
            }
        }
        bootbox.confirm("<strong style='font-size:15px;padding-left:200px'>确认删除所有数据吗？</strong>", function (result) {
            if (result) {
                $.ajax({
                    url: tcValidateProContext + '/validateProduct/TicketDeleteBatch?dateVO=' + dateVO + '&taskIDVO=' + taskID,
                    type: "GET",
                    async: false,
                    success: function (data) {
                        if (data.sessionStatus == 540) {//异步请求session过期状态
                            window.location.href = tcValidateProContext + "/login";
                            return;
                        }
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据删除成功！</strong>", function () {
                            window.location.reload();
                        });

                    }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                        bootbox.alert("<strong style='font-size:15px;padding-left:200px'>数据删除失败！</strong>");
                    }
                });
            }
        });

    }


</script>
</body>
</html>